#ifndef __IP_ARP_UDP_TCP_H__
#define __IP_ARP_UDP_TCP_H__
#include "global.h"

// you must call this function once before you use any of the other functions:
void InitEthernet(uchar *mymac,uchar *myip,uchar wwwp,uint udpp);
uchar ARPCheck(uchar *buf);
uchar IPCheck(uchar *buf);
uchar ICMPCheck(uchar *buf);
uchar UDPCheck(uchar *buf);
uchar TCPCheck(uchar *buf);
void ARPAnswer(uchar *buf);
void make_echo_reply_from_request(uchar *buf,uint len);
void make_udp_reply_from_request(uchar *buf,uchar *date,uchar datalen,uint port);


void make_tcp_synack_from_syn(uchar *buf);
void init_len_info(uchar *buf);
uint get_tcp_data_pointer(void);
uint fill_tcp_data_p(uchar *buf,uint pos, const uchar *progmem_s);
uint fill_tcp_data(uchar *buf,uint pos, const uchar *s);
void make_tcp_ack_from_any(uchar *buf);
void make_tcp_ack_with_data(uchar *buf,uint dlen);


#endif 
